package com.education.controller.backend;

import com.education.pojo.Recommend;
import com.education.service.RecommendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by Administrator on 2018/4/25.
 */

@Controller
public class RecommendController {
    @Autowired
    private RecommendService recommendService;
    @CrossOrigin
    @ResponseBody
    @RequestMapping("/recommend")
    public List<Recommend> get(@RequestBody Recommend recommends){
         System.out.println("ok");
         Integer rOrder=recommends.getrOrder();
         List<Recommend> recommend=recommendService.selectPicture(rOrder);
         return recommend;
    }
}
